-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alessandro/address bookmarks feedback folder logic #2221
Alessandro/address bookmarks feedback folder logic #2221
Conversation
…View to use same View struct
🚫 The Asana task linked in the PR description is not added to macOS App Board project.
|
private extension LocalBookmarkStore { | ||
|
||
@discardableResult | ||
func update(folder: BookmarkFolder, in context: NSManagedObjectContext) throws -> BookmarkEntity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was already existing, I just moved into its own function so that I can use either when the folder is updated (title changes) and when the folder moves within another parent folder
} | ||
|
||
func move(entities: [BookmarkEntity], toIndex index: Int?, withinParentFolderType type: ParentFolderType, in context: NSManagedObjectContext) throws { | ||
guard let rootFolder = bookmarksRoot(in: context) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I just moved this existing logic in its own function so I can use it when doing an update and move in one go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Job! 👏
@@ -468,6 +468,45 @@ final class LocalBookmarkStoreTests: XCTestCase { | |||
XCTAssertEqual(topLevelEntityIDs, [testState.initialParentFolder.id, testState.bookmark3.id]) | |||
} | |||
|
|||
func testWhenUpdatingAndMovingBookmarkFolder_ThenBookmarkFolderIsMovedAndTitleUpdated() async throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth testing also just moving the folder and just changing the title?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve checked and the tests weren’t there so I’ve added them (commit afeebfb)
f00d684
into
alessandro/address-bookmarks-feedback
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f **Description**: 1. Add logic and test for `AddEditBookmarkFolderViewModel`. 2. Make a common view to re-use by `AddBookmarkPopoverView` & `AddEditBookmarkDialogView` 3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title and location in one save.
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f **Description**: 1. Add logic and test for `AddEditBookmarkFolderViewModel`. 2. Make a common view to re-use by `AddBookmarkPopoverView` & `AddEditBookmarkDialogView` 3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title and location in one save.
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f **Description**: 1. Add logic and test for `AddEditBookmarkFolderViewModel`. 2. Make a common view to re-use by `AddBookmarkPopoverView` & `AddEditBookmarkDialogView` 3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title and location in one save.
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f **Description**: 1. Add logic and test for `AddEditBookmarkFolderViewModel`. 2. Make a common view to re-use by `AddBookmarkPopoverView` & `AddEditBookmarkDialogView` 3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title and location in one save.
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f **Description**: 1. Add logic and test for `AddEditBookmarkFolderViewModel`. 2. Make a common view to re-use by `AddBookmarkPopoverView` & `AddEditBookmarkDialogView` 3. Enhance `BookmarkManager` & `BookmarkStore` to update Folder title and location in one save.
Task/Issue URL: https://app.asana.com/0/72649045549333/1206590790808721/f
CC: @samsymons
Description:
AddEditBookmarkFolderViewModel
.AddBookmarkPopoverView
&AddEditBookmarkDialogView
BookmarkManager
&BookmarkStore
to update Folder title and location in one save.NOTE
Number 3 Involves some refactor in the
BookmarkStore
. Unit tests still pass and I’ve also added relevant ones. If it’s considered too high risk of a change I can discard last commit.Steps to test this PR:
<!—
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be marked with the
DO NOT MERGE
label (particularly if it's a draft)If it's pending Product Review/PFR, please add the
Pending Product Review
label.If at any point it isn't actively being worked on/ready for review/otherwise moving forward (besides the above PR/PFR exception) strongly consider closing it (or not opening it in the first place). If you decide not to close it, make sure it's labelled to make it clear the PRs state and comment with more information.
—>
—
Internal references:
Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation